/**
 * Copyright (c) 2009, 2010  Collaborative Development Group, C.S. Dept., University of Bari
 *
 * All rights reserved. This program and the accompanying materials are made available under
 * the terms of the Eclipse Public License v1.0  which accompanies this distribution, and is 
 * available at http://www.eclipse.org/legal/epl-v10.html
 */
package it.uniba.di.cdg.penelope.ui.test.mvp.scope;

import it.uniba.di.cdg.penelope.ui.annotation.Presenter;
import it.uniba.di.cdg.penelope.ui.mvp.AbstractPresenter;

import com.google.inject.Inject;

@Presenter( "login" ) 
//@ViewScoped( events = "login" )
public class MyPresenter extends AbstractPresenter {
	private final IMyView view;
	private final IMyViewModel viewModel;
	private final IMyModel model;

	@Inject
	public MyPresenter( IMyView view, IMyViewModel viewModel, IMyModel model ) {
		this.view = view;
		this.viewModel = viewModel;
		this.model = model;
	}

	public void whenOkButtonClicked() {
		System.out.println( "View signaled button clicked!" );
		viewModel.setMessage( model.createMessage() );
	}
}
